-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some tests that would fail with existing env vars #772
Fix some tests that would fail with existing env vars #772
Conversation
f096ffd
to
a016537
Compare
certification/runtime/config_test.go
Outdated
@@ -15,6 +16,10 @@ var _ = Describe("Viper to Runtime Config", func() { | |||
baseViperCfg = viper.New() | |||
expectedRuntimeCfg = &Config{} | |||
|
|||
if val, ok := os.LookupEnv("KUBECONFIG"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: good to merge without this change.
if val, ok := os.LookupEnv("KUBECONFIG"); ok { | |
if val, isSet := os.LookupEnv("KUBECONFIG"); isSet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happens in a couple of places, but because it's a nit, I'm only mentioning it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Some of the unit tests would fail if KUBECONFIG or PFLT_INDEXIMAGE were already present in the environment. This patch cleans those up a bit by checking for the existence, clearing them when required, and cleaning up appropriately after the test is run. This also includes minor renaming of some of the test suites, as they overlapped, and it was confusing where the error was actually coming from. Signed-off-by: Brad P. Crochet <brad@redhat.com>
a016537
to
41725c6
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: acornett21, bcrochet, komish, skattoju The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Some of the unit tests would fail if KUBECONFIG or PFLT_INDEXIMAGE
were already present in the environment. This patch cleans those up
a bit by checking for the existence, clearing them when required, and
cleaning up appropriately after the test is run.
This also includes minor renaming of some of the test suites, as they
overlapped, and it was confusing where the error was actually coming
from.
Signed-off-by: Brad P. Crochet brad@redhat.com